import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login/Login'

Vue.use(VueRouter);

// const Login = () => import('../views/Login/Login');
// const Index = () => import('../views/Index/Index');

// import Schedule from '../views/Index/Schedule/Schedule'
// import Profile from '../views/Index/Profile/Profile'
// import Train from "../views/Index/Profile/Train/Train"
// import Notice from "../views/Index/Profile/Notice/Notice";
// import Modify from "../views/Index/Profile/Modify/Modify";
// import Welcome from "../views/Welcome/Welcome";
// import Evaluation from "../views/Index/Evaluation/Evaluation";

/*主页面子路由*/
// const indexChildren = [
//   {
//     path: '',
//     redirect: '/index/schedule'
//   },
//   {
//     path: 'schedule',
//     component: Schedule
//   },
//   {
//     path: 'evaluation',
//     component: Evaluation
//   },
//   {
//     path: 'profile',
//     component: Profile
//   },
//   {
//     path: 'train',
//     component: Train
//   },
//   {
//     path: 'notice',
//     component: Notice
//   },
//   {
//     path: 'modify',
//     component: Modify
//   }
// ];

// /*配置路由*/
// const routes = [
//   {
//     //配置默认
//   path: '',
//   redirect: '/login'
// },
//  /* {
//     path: '',
//     component: Welcome
//   },*/
//   {
//     path: '/welcome',
//     component: Welcome
//   },
//   {
//     //配置主页面
//     path: '/index',
//     component: Index,
//     children: indexChildren
//   },
//   {
//     //配置登录
//     path: '/login',
//     component: Login
//   }
// ];

const router = new VueRouter({
  // mode:'history',
  base: '/CAAC_App/',
  routes: [
    {
      path: '/',
      redirect: {
        name: 'login'
      }
    },
    // {
    //   path: '/',
    //   name: 'login',
    //   component: Login
    // },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/schedule',
      name: 'schedule',
      component: () => import('../views/Index/Schedule/Schedule')
    },
    {
      path: '/profile',
      name: 'profile',
      component: () => import('../views/Index/Profile/Profile')
    },
    {
      path: '/train',
      name: 'train',
      component: () => import('../views/Index/Profile/Train/Train')
    },
    {
      path: '/notice',
      name: 'notice',
      component: () => import('../views/Index/Profile/Notice/Notice')
    },
    {
      path: '/modify',
      name: 'modify',
      component: () => import('../views/Index/Profile/Modify/Modify')
    },
 ]
});

export default router
